package com.openatc.extend.common.aop.log;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author ：panleilei
 * @description
 * @modified By：
 * @version:
 * @date ：Created in 2023/3/23 17:06
 */
@Component
@Aspect
@EnableAspectJAutoProxy(exposeProxy = true)
@ComponentScan
public class OperationRecordAspect {
    @Resource
    private SysLogProcessor processor;

    @Pointcut("@annotation(com.openatc.extend.common.aop.model.SysLog)")
    public void operationRecordPointCut() {

    }

    @Around("operationRecordPointCut()")
    public Object note(ProceedingJoinPoint point) throws Throwable {
        return processor.proceed(point);
    }
}
